import java.util.ArrayList;

/**
 * Description:
 *
 * @author houkepan
 * @date 2019/3/8 23:11
 */
public abstract class AllyControlCenter {
    protected String allyName;
    protected ArrayList<Observer> players = new ArrayList<Observer>();

    public void setAllyName(String allyName) {
        this.allyName = allyName;
    }

    public String getAllyName() {
        return this.allyName;
    }

    public void join(Observer observer) {
        System.out.println(observer.getName() + "加入" + this.allyName + "战队!");
        players.add(observer);
    }

    public void quit(Observer observer) {
        System.out.println(observer.getName() + "退出" + this.allyName + "战队!");
        players.remove(observer);
    }

    public abstract void notifyObserver(String name);
}
